<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>退款打印</title>
<t:base type="jquery,easyui,tools"></t:base>
<script type="text/javascript"  charset="utf-8" src="plug-in/qrcode/qrcode.min.js"></script>
<%--<script type="text/javascript"  charset="utf-8" src="plug-in/qrcode/jquery.min.js"></script>--%>
<script type="text/javascript" src="<%=basePath%>/plug-in/jquery/jquery.jqprint.js"></script>
<script language="javascript">
function printall(){
    smalltoBIG('jinexx','jinedx');

    $(".printdiv").jqprint();
}
function printview(){
	document.all.WebBrowser1.ExecWB(7,1);
}
function make2DCode() {
    $("#qrcode").html("");//清空二维码
    var qrcode;
    var codesize = 80;
    console.log(codesize);
    qrcode = new QRCode(document.getElementById("qrcode"), {
        width : codesize,
        height : codesize
    });
    qrcode.makeCode(document.getElementById("content").value);
};
// window.onload=function(){
//     make2DCode();
//     smalltoBIG('jinexx','jinedx');
// };

document.onreadystatechange = function () {
    if (document.readyState == "complete") {
        console.log("content");
        make2DCode();
    }
}
function downloadqrcode() {
    // 获取base64的图片节点
    var img = document.getElementById('qrcode').getElementsByTagName('img')[0];
    // 构建画布
    var canvas = document.createElement('canvas');
    canvas.width = img.width;
    canvas.height = img.height;
    canvas.getContext('2d').drawImage(img, 0, 0);
    // 构造url
    url = canvas.toDataURL('image/png');
    // 构造a标签并模拟点击
    var downloadLink = document.getElementById('downloadLink');
    downloadLink.setAttribute('href', url);
    downloadLink.setAttribute('download', '二维码.png');
    downloadLink.click();
};
function smalltoBIG(smallID,bigID)
{
    var aNum=$('#'+smallID).val();
    var n=aNum;
    var fraction = ['角', '分'];
    var digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
    var unit = [ ['元', '万', '亿'], ['', '拾', '佰', '仟']  ];
    var head = n < 0? '欠': '';
    n = Math.abs(n);

    var s = '';

    for (var i = 0; i < fraction.length; i++)
    {
        s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
    }
    s = s || '整';
    n = Math.floor(n);

    for (var i = 0; i < unit[0].length && n > 0; i++)
    {
        var p = '';
        for (var j = 0; j < unit[1].length && n > 0; j++)
        {
            p = digit[n % 10] + unit[1][j] + p;
            n = Math.floor(n / 10);
        }
        s = p.replace(/(零.)*零$/, '').replace(/^$/, '零')  + unit[0][i] + s;
    }
    //return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整');
    $('#'+bigID).val(head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整'));
}
</script>
	<style>
		tr
		{mso-height-source:auto;
			mso-ruby-visibility:none;}
		col
		{mso-width-source:auto;
			mso-ruby-visibility:none;}
		br
		{mso-data-placement:same-cell;}
		ruby
		{ruby-align:left;}
		.style0
		{mso-number-format:General;
			text-align:general;
			vertical-align:bottom;
			white-space:nowrap;
			mso-rotate:0;
			mso-background-source:auto;
			mso-pattern:auto;
			color:windowtext;
			font-size:10.0pt;
			font-weight:400;
			font-style:normal;
			text-decoration:none;
			font-family:Arial, sans-serif;
			mso-font-charset:0;
			border:none;
			mso-protection:locked visible;
			mso-style-name:常规;
			mso-style-id:0;}
		.font5
		{color:black;
			font-size:12.0pt;
			font-weight:400;
			font-style:normal;
			text-decoration:none;
			font-family:Arial, sans-serif;
			mso-font-charset:0;}
		.font8
		{color:black;
			font-size:12.0pt;
			font-weight:400;
			font-style:normal;
			text-decoration:none;
			font-family:黑体;
			mso-generic-font-family:auto;
			mso-font-charset:134;}
		.font9
		{color:black;
			font-size:12.0pt;
			font-weight:400;
			font-style:normal;
			text-decoration:none;
			font-family:Arial, sans-serif;
			mso-font-charset:0;}
		td
		{mso-style-parent:style0;
			padding-top:1px;
			padding-right:1px;
			padding-left:1px;
			mso-ignore:padding;
			color:windowtext;
			font-size:10.0pt;
			font-weight:400;
			font-style:normal;
			text-decoration:none;
			font-family:Arial, sans-serif;
			mso-font-charset:0;
			mso-number-format:General;
			text-align:general;
			vertical-align:bottom;
			border:none;
			mso-background-source:auto;
			mso-pattern:auto;
			mso-protection:locked visible;
			white-space:nowrap;
			mso-rotate:0;}
		.xl65
		{mso-style-parent:style0;
			color:black;
			font-size:12.0pt;
			text-align:center;
			border:1.0pt solid black;}
		.xl66
		{mso-style-parent:style0;
			color:black;
			font-size:12.0pt;
			white-space:normal;}
		.xl67
		{mso-style-parent:style0;
			color:black;
			font-size:14.0pt;
			font-weight:700;
			font-family:黑体;
			mso-generic-font-family:auto;
			mso-font-charset:134;
			text-align:center;}
		.xl68
		{mso-style-parent:style0;
			color:black;
			font-size:12.0pt;
			font-family:黑体;
			mso-generic-font-family:auto;
			mso-font-charset:134;
			text-align:center;
			border:1.0pt solid black;}
		.xl69
		{mso-style-parent:style0;
			color:black;
			font-size:12.0pt;}
		.xl70
		{mso-style-parent:style0;
			color:black;
			font-size:12.0pt;
			text-align:center;
			border-top:1.0pt solid black;
			border-right:none;
			border-bottom:1.0pt solid black;
			border-left:1.0pt solid black;}
		.xl71
		{mso-style-parent:style0;
			color:black;
			font-size:12.0pt;
			text-align:center;
			border-top:1.0pt solid black;
			border-right:none;
			border-bottom:1.0pt solid black;
			border-left:none;}
		.xl72
		{mso-style-parent:style0;
			color:black;
			font-size:12.0pt;
			text-align:center;
			border-top:1.0pt solid black;
			border-right:1.0pt solid black;
			border-bottom:1.0pt solid black;
			border-left:none;}
		.xl73
		{mso-style-parent:style0;
			color:black;
			font-size:12.0pt;
			font-family:黑体;
			mso-generic-font-family:auto;
			mso-font-charset:134;
			text-align:center;
			border-top:1.0pt solid black;
			border-right:none;
			border-bottom:1.0pt solid black;
			border-left:1.0pt solid black;}
		.xl74
		{mso-style-parent:style0;
			color:black;
			font-size:12.0pt;
			font-family:黑体;
			mso-generic-font-family:auto;
			mso-font-charset:134;
			text-align:center;
			border-top:1.0pt solid black;
			border-right:1.0pt solid black;
			border-bottom:1.0pt solid black;
			border-left:none;}
		.xl75
		{mso-style-parent:style0;
			color:black;
			font-size:12.0pt;
			font-family:黑体;
			mso-generic-font-family:auto;
			mso-font-charset:134;
			white-space:normal;}
		.xl76
		{mso-style-parent:style0;
			text-align:center;}

	</style>

</head>
<body style="overflow-y:hidden" scroll="no">
<div class="printdiv"><t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table"  >
	<input id="content" type="hidden" value="${tKpYushouPage.skid}">

	<table border=0 cellpadding=0 cellspacing=0 width=580 style='border-collapse:
 collapse;table-layout:fixed;width:451pt;margin-left: 40px;margin-top: -30px'>
		<col   style=' width:90pt'>
		<col   style=' width:90pt'>
		<col  style=' width:60pt'>
		<col   span=2 style=' width:60pt'>
		<col    style=' width:30pt'>
		<col   style=' width:4pt'>
		<col   style=' width:4pt'>
		<tr height=18 style='height:13.2pt'>
			<td colspan=8 height=18 width=630 style='height:13.2pt;width:471pt'></td>
		</tr>
		<tr height=40 style='mso-height-source:userset;height:30.0pt'>
			<td colspan=3 height=40 class=xl67 style='height:30.0pt;text-align: center;'><span style="font-size: 16pt">荆门新兴建材有限责任公司</span></td>
			<td colspan=3 class=xl66 align=right width=168 style='width:126pt;text-align: left;margin-left: 20px'>日期：${kprq}</td>
			<td rowspan=2 class=xl76>
				<%--<div id="qrcode" style="width:80px; height:80px;margin-top: 10px;margin-left: -10px"></div>--%>
			</td>
			<td colspan=1 style='mso-ignore:colspan'></td>
		</tr>
		<tr height=40 style='mso-height-source:userset;height:30.0pt'>
			<td colspan=3 height=40 class=xl67 style='height:30.0pt;text-align: center;'><span style="font-size: 12pt">粉煤灰产品退款单</span></td>
			<td colspan=2 class=xl66 align=right width=168 style='width:126pt;text-align: left;margin-left: 20px'>流水号：${tKpYushouPage.skid}</td>
			<td colspan=2 style='mso-ignore:colspan'></td>
		</tr>
		<tr height=40 style='mso-height-source:userset;height:30.0pt'>
			<td colspan=1 height=40 class=xl75 width=287 style='height:30.0pt;width:215pt'><span style="font-size: 13pt">客户：${tKpYushouPage.cusName}</span></td>
			<td colspan=7 class=xl75 width=337 style='width:252pt;margin-left: 20px'><span style="font-size: 13pt">工地：${tKpYushouPage.gdName}</span></td>

		</tr>
		<tr height=33 style='mso-height-source:userset;height:25.05pt'>
			<td height=33 class=xl68 style='height:25.05pt;border:1.0pt solid black;text-align: center'>代码</td>
			<td class=xl68 style='border:1.0pt solid black;text-align: center'>产品</td>
			<td   class=xl73 style='border:1.0pt solid black;text-align: center'>单价</td>

			<td   class=xl73 style='border:1.0pt solid black;text-align: center'>退款方式</td>
			<td colspan=3 class=xl73 style='border:1.0pt solid black;text-align: center'>金额</td>
			<td></td>
		</tr>
		<c:if test="${fn:length(tKpYushouList)  > 0 }">
		<c:forEach items="${tKpYushouList}" var="poVal" varStatus="stuts">

		<tr height=33 style='mso-height-source:userset;height:25.05pt'>
			<td height=33 class=xl65 style='height:25.05pt;border:1.0pt solid black;text-align: center'>${poVal.gdDaaima}</td>
			<td class=xl65 style='border-top:none;border:1.0pt solid black;text-align: center'>${poVal.by1}</td>
			<td   class=xl70 style='border:1.0pt solid black;text-align: center'> </td>
			<td   class=xl70 style='border:1.0pt solid black;text-align: center'>${poVal.ysFangshi}</td>
			<td colspan=3 class=xl70 style='border:1.0pt solid black;text-align: center'>${poVal.ysJine}</td>
			<td></td>
		</tr>

		</c:forEach>
		</c:if>
		<tr height=33 style='mso-height-source:userset;height:25.05pt'>
			<td   height=33 class=xl73 style='height:25.05pt;border:1.0pt solid black;text-align: center'>金额合计（大写）</td>
			<td colspan=2 class=xl70 style='border:1.0pt solid black;text-align: center'>${jinedx}</td>
			<td   height=33 class=xl73 style='height:25.05pt;border:1.0pt solid black;text-align: center'>金额合计 </td>
			<td colspan=3  class=xl70 style='border:1.0pt solid black;text-align: center'>${tKpYushouPage.skAmount}</td>
		</tr>
		<tr height=33 style='mso-height-source:userset;height:25.05pt'>
			<td height=33 class=xl68 style='height:25.05pt;border:1.0pt solid black;text-align: center'>备注</td>
			<td colspan=6 class=xl70 style='border:1.0pt solid black;'>　${tKpYushouPage.skRemark}</td>
			<td></td>
		</tr>
		<tr height=21 style='height:25.6pt'>
			<td height=21 class=xl69 colspan=1 style='margin-top:10px;height:15.6pt;mso-ignore:colspan;text-align: justify'><font
					class="font8">部门盖章：</font>
			</td>
			<td colspan=2 align="center">
			</font><font class="font8">收款人：</font><font class="font5"> </font><font
					class="font9">${tKpYushouPage.createBy}</font>
			</td>
			<td >
			</td>
			<td colspan=3>
			</font><font class="font8">经办人：</font><font class="font5">

			</td>
		</tr>
		<%--<![if supportMisalignedColumns]>--%>
		<%--<tr height=0 style='display:none'>--%>
			<%--<td   style='width:90pt'></td>--%>
			<%--<td   style='width:101pt'></td>--%>
			<%--<td   style='width:34pt'></td>--%>
			<%--<td  style='width:63pt'></td>--%>
			<%--<td  style='width:63pt'></td>--%>
			<%--<td  style='width:50pt'></td>--%>
			<%--<td  style='width:50pt'></td>--%>
			<%--<td width=6 style='width:4pt'></td>--%>
		<%--</tr>--%>
		<%--<![endif]>--%>
	</table>
</t:formvalid></div>
<a class="easyui-linkbutton" style="margin-top:3px" icon="icon-print" href="javascript:printall()">打印</a>
</body>